```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Kafka架构革新：告别Zookeeper的时代</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.8;
        }
        .hero {
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: white;
        }
        .card {
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        }
        .highlight {
            position: relative;
        }
        .highlight:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 10px;
            background: rgba(74, 144, 226, 0.2);
            z-index: -1;
        }
        .section-title {
            position: relative;
            padding-left: 1.5rem;
        }
        .section-title:before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 5px;
            height: 80%;
            background: #4a90e2;
            border-radius: 3px;
        }
        .feature-icon {
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            margin-bottom: 1rem;
        }
        .footer-link:hover {
            color: #4a90e2 !important;
        }
        @media (max-width: 768px) {
            .hero-content {
                padding-top: 3rem;
                padding-bottom: 3rem;
            }
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero py-20">
        <div class="container mx-auto px-6">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4 text-white leading-tight">Kafka架构革新</h1>
                    <h2 class="text-2xl md:text-3xl font-semibold mb-6 text-blue-200">告别Zookeeper的时代</h2>
                    <p class="text-lg text-blue-100 mb-8 max-w-lg">探索Kafka如何通过自身实现的元数据管理和分布式协调机制，实现性能提升、架构简化，并提高系统整体稳定性和可靠性。</p>
                    <div class="flex space-x-4">
                        <a href="#advantages" class="bg-white text-blue-700 hover:bg-blue-50 px-6 py-3 rounded-lg font-medium transition duration-300">核心优势</a>
                        <a href="#architecture" class="border border-white text-white hover:bg-white hover:text-blue-700 px-6 py-3 rounded-lg font-medium transition duration-300">架构对比</a>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="relative">
                        <div class="absolute inset-0 bg-gradient-to-r from-blue-500 to-blue-700 rounded-2xl transform -rotate-6"></div>
                        <div class="relative bg-white rounded-2xl p-6 shadow-xl transform rotate-1">
                            <div class="flex items-center mb-4">
                                <div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <div class="bg-gray-100 p-4 rounded-lg mb-4 overflow-x-auto">
                                <pre class="text-sm text-gray-800">
<span class="text-blue-600">class</span> <span class="text-green-600">KafkaCluster</span> {
  <span class="text-purple-600">private</span> MetadataCache metadataCache;
  <span class="text-purple-600">private</span> Controller controller;
  
  <span class="text-blue-600">public</span> <span class="text-green-600">void</span> <span class="text-yellow-600">startAsController</span>() {
    <span class="text-gray-500">// 基于Raft协议实现元数据管理</span>
    <span class="text-red-600">this</span>.metadataCache = <span class="text-blue-600">new</span> MetadataCache();
    <span class="text-red-600">this</span>.controller = <span class="text-blue-600">new</span> Controller();
  }
  
  <span class="text-blue-600">public</span> <span class="text-green-600">void</span> <span class="text-yellow-600">handleMetadataUpdate</span>(MetadataUpdate update) {
    <span class="text-gray-500">// 分布式协调机制处理元数据更新</span>
    metadataCache.apply(update);
    controller.propagate(update);
  }
}</pre>
                            </div>
                            <div class="flex justify-between text-xs text-gray-500">
                                <span>Kafka Raft Metadata Mode</span>
                                <span>KRaft Protocol</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Key Benefits Section -->
    <section id="advantages" class="py-16 bg-white">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <span class="inline-block bg-blue-100 text-blue-700 px-4 py-2 rounded-full text-sm font-medium mb-4">核心优势</span>
                <h2 class="text-3xl md:text-4xl font-bold text-gray-800 mb-4">Kafka移除Zookeeper带来的五大改进</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">通过内置元数据管理系统，Kafka实现了架构上的重大突破</p>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
                <div class="card bg-white p-8 rounded-xl">
                    <div class="feature-icon bg-red-100 text-red-600">
                        <i class="fas fa-tachometer-alt text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">性能提升</h3>
                    <p class="text-gray-600">移除Zookeeper消除了集中式架构的性能瓶颈，Kafka可以更高效地处理元数据操作，尤其在大规模集群中表现更佳。</p>
                </div>
                
                <div class="card bg-white p-8 rounded-xl">
                    <div class="feature-icon bg-blue-100 text-blue-600">
                        <i class="fas fa-project-diagram text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">架构简化</h3>
                    <p class="text-gray-600">不再需要维护独立的Zookeeper集群，减少了系统组件数量，降低了运维复杂度，提升了系统的整体可靠性。</p>
                </div>
                
                <div class="card bg-white p-8 rounded-xl">
                    <div class="feature-icon bg-green-100 text-green-600">
                        <i class="fas fa-shield-alt text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">高可用性</h3>
                    <p class="text-gray-600">基于Raft协议的内置元数据管理系统，为Kafka提供了更强的一致性和故障恢复能力，系统可用性显著提高。</p>
                </div>
                
                <div class="card bg-white p-8 rounded-xl">
                    <div class="feature-icon bg-purple-100 text-purple-600">
                        <i class="fas fa-cogs text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">简化管理</h3>
                    <p class="text-gray-600">不再需要处理Kafka与Zookeeper之间的复杂协调问题，系统管理更加直观和集中。</p>
                </div>
                
                <div class="card bg-white p-8 rounded-xl">
                    <div class="feature-icon bg-yellow-100 text-yellow-600">
                        <i class="fas fa-expand text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">扩展能力</h3>
                    <p class="text-gray-600">Kafka可以更灵活地实现和优化新功能，不再受限于Zookeeper的能力，为未来扩展奠定了基础。</p>
                </div>
                
                <div class="card bg-white p-8 rounded-xl">
                    <div class="feature-icon bg-indigo-100 text-indigo-600">
                        <i class="fas fa-bolt text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">快速响应</h3>
                    <p class="text-gray-600">减少了网络跳数和外部依赖，元数据操作延迟降低，系统响应速度更快。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Architecture Comparison Section -->
    <section id="architecture" class="py-16 bg-gray-50">
        <div class="container mx-auto px-6">
            <div class="text-center mb-12">
                <span class="inline-block bg-blue-100 text-blue-700 px-4 py-2 rounded-full text-sm font-medium mb-4">架构演化</span>
                <h2 class="text-3xl md:text-4xl font-bold text-gray-800 mb-4">新旧架构对比分析</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">深入理解Kafka从依赖Zookeeper到自包含系统的转变</p>
            </div>
            
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-12">
                <div>
                    <div class="bg-white p-6 rounded-xl shadow-md mb-8">
                        <div class="flex items-center mb-4">
                            <div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-4">
                                <i class="fas fa-server text-red-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">传统架构 (依赖Zookeeper)</h3>
                        </div>
                        
                        <div class="space-y-4">
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-red-100 flex items-center justify-center">
                                        <i class="fas fa-minus text-red-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">Zookeeper作为外部协调服务，成为性能瓶颈</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-red-100 flex items-center justify-center">
                                        <i class="fas fa-minus text-red-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">需要维护两个独立集群（Kafka和Zookeeper）</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-red-100 flex items-center justify-center">
                                        <i class="fas fa-minus text-red-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">网络通信开销增加，延迟较高</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-red-100 flex items-center justify-center">
                                        <i class="fas fa-minus text-red-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">扩展能力受限于Zookeeper</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-white p-6 rounded-xl shadow-md">
                        <div class="mermaid">
                            graph TD
                            A[Kafka Broker] -->|依赖| B[Zookeeper集群]
                            C[Kafka Broker] -->|依赖| B
                            D[Kafka Broker] -->|依赖| B
                            B --> E[集中式元数据存储]
                            style B fill:#fecaca,stroke:#f87171
                            style E fill:#fecaca,stroke:#f87171
                        </div>
                    </div>
                </div>
                
                <div>
                    <div class="bg-white p-6 rounded-xl shadow-md mb-8">
                        <div class="flex items-center mb-4">
                            <div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mr-4">
                                <i class="fas fa-rocket text-green-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">新架构 (KRaft模式)</h3>
                        </div>
                        
                        <div class="space-y-4">
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-green-100 flex items-center justify-center">
                                        <i class="fas fa-plus text-green-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">内置元数据管理，消除外部依赖</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-green-100 flex items-center justify-center">
                                        <i class="fas fa-plus text-green-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">基于Raft协议的分布式一致性</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-green-100 flex items-center justify-center">
                                        <i class="fas fa-plus text-green-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">更低的延迟，更高的吞吐量</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-5 h-5 rounded-full bg-green-100 flex items-center justify-center">
                                        <i class="fas fa-plus text-green-600 text-xs"></i>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700">简化部署和运维</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-white p-6 rounded-xl shadow-md">
                        <div class="mermaid">
                            graph TD
                            A[Kafka Broker 1] -->|Raft协议| B[Kafka Broker 2]
                            A -->|Raft协议| C[Kafka Broker 3]
                            B -->|Raft协议| C
                            D[分布式元数据存储] --> A
                            D --> B
                            D --> C
                            style D fill:#bbf7d0,stroke:#4ade80
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Detailed Analysis Section -->
    <section class="py-16 bg-white">
        <div class="container mx-auto px-6 max-w-4xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">Kafka移除Zookeeper的深度解析</h2>
            
            <div class="space-y-12">
                <div>
                    <h3 class="section-title text-2xl font-bold mb-4 text-gray-800">1. 性能瓶颈的突破</h3>
                    <p class="text-gray-700 mb-4">Zookeeper虽然在分布式系统中扮演了协调服务的关键角色，但它在处理大量节点和高并发请求时可能成为性能瓶颈。Kafka的设计目标是提供高吞吐量和低延迟的消息传递系统，但Zookeeper的集中式架构可能影响Kafka的性能。</p>
                    <p class="text-gray-700">Kafka在处理大规模数据流时，需要高效的元数据管理，而Zookeeper的写操作开销较高，尤其是在节点数量增加时，Zookeeper的性能可能会下降。通过移除Zookeeper，Kafka能够实现更高效的元数据操作，满足高吞吐量场景的需求。</p>
                </div>
                
                <div>
                    <h3 class="section-title text-2xl font-bold mb-4 text-gray-800">2. 系统复杂性的降低</h3>
                    <p class="text-gray-700 mb-4">Zookeeper是一个独立的服务，要求Kafka集群和Zookeeper集群之间进行复杂的协调和管理。Kafka在使用Zookeeper时需要处理与Zookeeper之间的网络通信、故障转移、数据一致性等问题。</p>
                    <p class="text-gray-700">将这些责任交给Zookeeper会增加系统的复杂性，并且使得Kafka依赖于外部的协调服务。新的KRaft模式通过将元数据管理内置于Kafka中，显著简化了系统架构，降低了运维难度。</p>
                </div>
                
                <div>
                    <h3 class="section-title text-2xl font-bold mb-4 text-gray-800">3. 高可用性和一致性的提升</h3>
                    <p class="text-gray-700 mb-4">Zookeeper通过ZAB协议（Zookeeper Atomic Broadcast）来实现高可用性和一致性，但这种机制在Kafka的特定场景下并不完全匹配。Kafka的元数据管理和分布式协调需要支持快速的元数据更新和高效的节点管理。</p>
                    <p class="text-gray-700">Kafka的新架构旨在通过内部的元数据管理和协调机制来提高系统的可用性和一致性，避免了Zookeeper可能带来的延迟和一致性问题。基于Raft协议的实现更适合Kafka的分布式消息传递模型。</p>
                </div>
                
                <div>
                    <h3 class="section-title text-2xl font-bold mb-4 text-gray-800">4. 架构简化的优势</h3>
                    <p class="text-gray-700 mb-4">Kafka开发团队希望简化Kafka的架构，通过移除Zookeeper来减少系统组件的数量。移除Zookeeper之后，Kafka可以采用更简单和集中的元数据管理机制。</p>
                    <p class="text-gray-700">这种简化不仅减少了系统的运维复杂度，还降低了系统故障的可能性。新版本的Kafka通过KRaft（Kafka Raft Metadata mode）来实现元数据的管理，KRaft模式基于Raft协议来保证系统的一致性和可靠性。</p>
                </div>
                
                <div>
                    <h3 class="section-title text-2xl font-bold mb-4 text-gray-800">5. 功能扩展的灵活性</h3>
                    <p class="text-gray-700 mb-4">Kafka的设计目标是支持大规模的消息流和流处理应用。在新的架构中，Kafka可以更好地控制自身的功能扩展，尤其是在支持更复杂的消息处理模式和集群管理方面。</p>
                    <p class="text-gray-700">移除Zookeeper后，Kafka可以独立地实现和优化新的特性和功能，从而提高整体系统的灵活性和可扩展性。这为Kafka未来的发展奠定了坚实的基础，使其能够更好地适应不断变化的技术需求。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Transition Guide Section -->
    <section class="py-16 bg-blue-50">
        <div class="container mx-auto px-6 max-w-4xl">
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-blue-700 p-8 flex items-center justify-center">
                        <div class="text-center">
                            <i class="fas fa-exchange-alt text-white text-5xl mb-4"></i>
                            <h3 class="text-xl font-bold text-white">架构转型指南</h3>
                        </div>
                    </div>
                    <div class="md:w-2/3 p-8">
                        <h2 class="text-2xl font-bold mb-4 text-gray-800">从Zookeeper迁移到KRaft模式</h2>
                        <p class="text-gray-600 mb-6">了解如何将现有的Kafka集群从Zookeeper模式平滑过渡到KRaft模式。</p>
                        
                        <div class="space-y-4">
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-6 h-6 rounded-full bg-blue-100 flex items-center justify-center">
                                        <span class="text-blue-600 font-bold text-sm">1</span>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700 font-medium">评估兼容性</p>
                                    <p class="text-gray-600 text-sm">检查当前Kafka版本是否支持KRaft模式，以及所有依赖组件是否兼容。</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-6 h-6 rounded-full bg-blue-100 flex items-center justify-center">
                                        <span class="text-blue-600 font-bold text-sm">2</span>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700 font-medium">配置KRaft集群</p>
                                    <p class="text-gray-600 text-sm">设置新的Kafka集群为KRaft模式，配置控制器节点和元数据存储参数。</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-6 h-6 rounded-full bg-blue-100 flex items-center justify-center">
                                        <span class="text-blue-600 font-bold text-sm">3</span>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700 font-medium">数据迁移</p>
                                    <p class="text-gray-600 text-sm">将现有数据迁移到新的KRaft集群，或逐步将Zookeeper模式集群升级为KRaft模式。</p>
                                </div>
                            </div>
                            
                            <div class="flex items-start">
                                <div class="flex-shrink-0 mt-1">
                                    <div class="w-6 h-6 rounded-full bg-blue-100 flex items-center justify-center">
                                        <span class="text-blue-600 font-bold text-sm">4</span>
                                    </div>
                                </div>
                                <div class="ml-3">
                                    <p class="text-gray-700 font-medium">测试验证</p>
                                    <p class="text-gray-600 text-sm">全面测试新集群的功能、性能和稳定性，确保业务平稳过渡。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Future Outlook Section -->
    <section class="py-16 bg-gray-900 text-white">
        <div class="container mx-auto px-6 max-w-4xl text-center">
            <i class="fas fa-lightbulb text-yellow-400 text-4xl mb-6"></i>
            <h2 class="text-3xl font-bold mb-6">Kafka未来的发展方向</h2>
            <p class="text-xl text-gray-300 mb-8">随着KRaft模式的成熟和普及，Kafka将进入一个更加自主、高效的新时代。这一架构变革不仅解决了当前的技术挑战，还为Kafka的未来发展开辟了更多可能性：</p>
            
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8 mb-12">
                <div class="bg-gray-800 p-6 rounded-lg">
                    <i class="fas fa-cloud text-blue-400 text-2xl mb-4"></i>
                    <h3 class="text-xl font-bold mb-2">云原生集成</h3>
                    <p class="text-gray-400">更好地与云平台和容器编排系统集成，实现弹性伸缩和自动化管理。</p>
                </div>
                <div class="bg-gray-800 p-6 rounded-lg">
                    <i class="fas fa-stream text-green-400 text-2xl mb-4"></i>
                    <h3 class="text-xl font-bold mb-2">流处理增强</h3>
                    <p class="text-gray-400">更紧密地与流处理框架集成，提供端到端的流式解决方案。</p>
                </div>
                <div class="bg-gray-800 p-6 rounded-lg">
                    <i class="fas fa-cogs text-purple-400 text-2xl mb-4"></i>
                    <h3 class="text-xl font-bold mb-2">运维简化</h3>
                    <p class="text-gray-400">进一步简化运维操作，提供更直观的管理界面和自动化工具。</p>
                </div>
            </div>
            
            <p class="text-lg text-gray-300">Kafka移除Zookeeper的决策体现了项目团队对技术本质的深刻理解和前瞻性思考，这一变革将确保Kafka在未来分布式系统领域继续保持领先地位。</p>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-800 py-8">
        <div class="container mx-auto px-6">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-white text-lg font-bold">技术小馆</h3>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="footer-link text-gray-400 hover:text-white transition duration-300">http://www.yuque.com/jtostring</a>
                </div>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // Smooth scrolling for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>
```